package dao

import (
	"database/sql"
	_ "github.com/go-sql-driver/mysql" // 导入MySQL驱动
)

var Db *sql.DB

func init() {
	dsn := "root:123456@tcp(127.0.0.1:3306)/book_manager?charset=utf8mb4&parseTime=True"

	Db, _ = sql.Open("mysql", dsn)

	if err := Db.Ping(); err != nil {
		panic(err)
	}
	
}
